home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / utils / file / managers / mc-3.2 / mc-3 / mc-3.2.1 / src / mad.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-17  |  1.0 KB  |  47 lines

  1. #ifndef __MAD_H
  2. #define __MAD_H
  3.  
  4. #ifdef HAVE_MAD
  5. #   define INLINE 
  6. #else
  7. #   ifndef INLINE
  8. #       define INLINE inline
  9. #   endif
  10. #endif
  11.  
  12. #ifdef HAVE_MAD
  13.  
  14. /* The Memory Allocation Debugging system */
  15.  
  16. /* GNU headers define this as macros */
  17. #ifdef malloc
  18. #   undef malloc
  19. #endif
  20.  
  21. #ifdef calloc
  22. #   undef calloc
  23. #endif
  24.  
  25. #define malloc(x)    mad_alloc (x, __FILE__, __LINE__)
  26. #define calloc(x, y)    mad_alloc (x * y, __FILE__, __LINE__)
  27. #define realloc(x, y)    mad_realloc (x, y, __FILE__, __LINE__)
  28. #define xmalloc(x, y)    mad_alloc (x, __FILE__, __LINE__)
  29. #define strdup(x)    mad_strdup (x, __FILE__, __LINE__)
  30. #define free(x)        mad_free (x, __FILE__, __LINE__)
  31.  
  32. void mad_check (char *file, int line);
  33. void *mad_alloc (int size, char *file, int line);
  34. void *mad_realloc (void *ptr, int newsize, char *file, int line);
  35. char *mad_strdup (char *s, char *file, int line);
  36. void mad_free (void *ptr, char *file, int line);
  37. void mad_finalize (char *file, int line);
  38.  
  39. #else
  40.  
  41. #define mad_finalize(x, y)
  42. #define mad_check(file,line)
  43.  
  44. #endif /* HAVE_MAD */
  45.  
  46. #endif /* __MAD_H */
  47.